package main

import (
	"net/http"
	"net/http/httputil"
	"net/url"
)

func Backend(w http.ResponseWriter, r *http.Request) {
	u, _ := url.Parse("http://172.31.36.232:32682")
	proxy := httputil.NewSingleHostReverseProxy(u)
	//proxy.Director = func(request *http.Request) {
	//	request.URL.Host = "172.31.36.232:32682"
	//	request.URL.Scheme = "http"
	//	request.URL.Path = "/debug/pprof/"
	//	request.RequestURI = r.RequestURI
	//	request.Host = "172.31.36.232:32682"
	//}
	proxy.ServeHTTP(w, r)
}

func main() {
	http.HandleFunc("/debug/pprof/01/", Backend)
	http.ListenAndServe(":8080", nil)
}
